<?php


namespace App\Model\Mysql;


use EasySwoole\Mysqli\QueryBuilder;

class ProjectTopicModel extends BaseModel
{
    protected $tableName = 'pro_project_topic';
    protected $autoTimeStamp = true;

    public function content($field = '*')
    {
        return $this->hasMany(ProjectTopicContentModel::class, function (QueryBuilder $query) use ($field) {
            $query->fields($field);
            return $query;
        }, 'id', 'topic_id');
    }
}